﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Spine.Unity;

public class SpineAnimator :StateMachineBehaviour 
{
    public int track = 0;
    public string animationName;

    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        SkeletonGraphic spineGrahic = animator.gameObject.GetComponent<SkeletonGraphic>();
        spineGrahic.AnimationState.SetAnimation(layerIndex, animationName, stateInfo.loop);
    }
}
